import Vue from 'vue'
import VueRouter from 'vue-router'
import homePage from '../views/homePage.vue'
import login from '../views/login.vue'
import register from '../views/register.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'homePage',
    component: homePage,
  },
  {
    path: '/login',
    name: 'login',
    component: login,
  },
  {
    path: '/register',
    name: 'register',
    component: register,
  },
  {
    path: '/financingProducts',
    name: 'financingProducts',
    component: () => import('../views/financingProducts.vue'),
    meta: {
      breadCrumbsName: ['贷款产品'],
      breadCrumbsHref: ''
    }
  },
  {
    path: '/financingProductsDetails',
    name: 'financingProductsDetails',
    component: () => import('../views/financingProductsDetails.vue'),
    meta: {
      breadCrumbsName: ['贷款产品', '贷款产品详情'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/infoList',
    name: 'infoList',
    component: () => import('../views/infoList.vue'),
    meta: {
      breadCrumbsName: ['政策资讯'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/infoDetails',
    name: 'infoDetails',
    component: () => import('../views/infoDetails.vue'),
    meta: {
      breadCrumbsName: ['政策资讯', '政策资讯详情'],
      breadCrumbsHref: '/infoList'
    }
  },
  {
    path: '/legalPerson',
    name: 'legalPerson',
    component: () => import('../views/directionaFinancingApplication/legalPerson.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/unLegalPerson',
    name: 'unLegalPerson',
    component: () => import('../views/directionaFinancingApplication/unLegalPerson.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/companyCheck',
    name: 'companyCheck',
    component: () => import('../views/directionaFinancingApplication/companyCheck.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/companyMsg',
    name: 'companyMsg',
    component: () => import('../views/directionaFinancingApplication/companyMsg.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }

  },
  {
    path: '/submittedSuccessfully',
    name: 'submittedSuccessfully',
    component: () => import('../views/directionaFinancingApplication/submittedSuccessfully.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/aboutUs',
    name: 'abourUs',
    component: () => import('../views/homePageComp/aboutUs.vue'),
    meta: {
      breadCrumbsName: ['关于我们'],
    }
  },
  {
    path: '/nondirlegalPerson',
    name: 'legalPerson',
    component: () => import('../views/unDirectionaFinancingApplication/nondirlegalPerson.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/nondirunLegalPerson',
    name: 'unLegalPerson',
    component: () => import('../views/unDirectionaFinancingApplication/nondirunLegalPerson.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/nondircompanyCheck',
    name: 'companyCheck',
    component: () => import('../views/unDirectionaFinancingApplication/nondircompanyCheck.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/nondircompanyMsg',
    name: 'companyMsg',
    component: () => import('../views/unDirectionaFinancingApplication/nondircompanyMsg.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/nondirsubmittedSuccessfully',
    name: 'submittedSuccessfully',
    component: () => import('../views/unDirectionaFinancingApplication/nondirsubmittedSuccessfully.vue'),
    meta: {
      breadCrumbsName: ['金融产品', '融资申请'],
      breadCrumbsHref: '/financingProducts'
    }
  },
  {
    path: '/myHomePage',
    name: 'myHomePage',
    component: () => import('../views/personalCenter/myHomePage.vue'),
    meta: {
      breadCrumbsName: ['个人中心'],
      breadCrumbsHref: ''
    },
    children: [
      {
        path: '/personalCenter',
        redirect: '/personalCenter/home',
        component: () => import('../views/personalCenter/home.vue'),
        meta: {
          breadCrumbsName: ['个人中心'],
        }
      },
      {
        path: '/personalCenterHome',
        name: 'home',
        component: () => import('../views/personalCenter/home.vue'),
        meta: {
          breadCrumbsName: ['个人中心'],
        }
      },
      {
        path: '/personalCenterMyApplication',
        name: 'myApplication',
        component: () => import('../views/personalCenter/myApplication.vue'),
        meta: {
          breadCrumbsName: ['个人中心'],
        }
      },
      {
        path: '/personalCenterMyCollection',
        name: 'myCollection',
        component: () => import('../views/personalCenter/myCollection.vue'),
        meta: {
          breadCrumbsName: ['个人中心'],
        }
      },
      {
        path: '/personalCenterChangePassword',
        name: 'changePassword',
        component: () => import('../views/personalCenter/changePassword.vue'),
        meta: {
          breadCrumbsName: ['个人中心'],
        }
      },
      {
        path: '/personalCenterCompanyInformation',
        name: 'companyInformation',
        component: () => import('../views/personalCenter/companyInformation.vue'),
        meta: {
          breadCrumbsName: ['个人中心'],
        }
      },
      {
        path: '/personalCenterMyFootprint',
        name: 'myFootprint',
        component: () => import('../views/personalCenter/myFootprint.vue'),
        meta: {
          breadCrumbsName: ['个人中心'],
        }
      },
      {
        path: '/personalCenterDirectionalDetail',
        name: 'directionalDetail',
        component: () => import('../views/personalCenter/directionalDetail.vue'),
        meta: {
          breadCrumbsName: ['个人中心'],
        }
      },
      {
        path: '/personalCenterUnDirectionalDetail',
        name: 'unDirectionalDetail',
        component: () => import('../views/personalCenter/unDirectionalDetail.vue'),
        meta: {
          breadCrumbsName: ['个人中心'],
        }
      }
    ]
  },
  {
    path: '/creditReport', // 征信报告声明
    name: 'creditReport',
    component: () => import('../views/readInformation/creditReport.vue'),
    meta: {
      breadCrumbsName: ['征信报告声明'],
    }
  },
  {
    path: '/privacyStatement', // 隐私声明
    name: 'privacyStatement',
    component: () => import('../views/readInformation/privacyStatement.vue'),
    meta: {
      breadCrumbsName: ['隐私声明'],
    }
  },
  {
    path: '/serviceAgreement', // 服务协议
    name: 'serviceAgreement',
    component: () => import('../views/readInformation/serviceAgreement.vue'),
    meta: {
      breadCrumbsName: ['服务协议'],
    }
  },
  {
    path: '/userAgreement', // 信用报告、供应商信用评价用户协议
    name: 'userAgreement',
    component: () => import('../views/readInformation/userAgreement.vue'),
    meta: {
      breadCrumbsName: ['信用报告、供应商信用评价用户协议'],
    }
  }
]

const router = new VueRouter({
  mode: "history",
  routes
})

export default router
